package com.bj.zspace.bytebuddy.bbtest;

import net.bytebuddy.asm.Advice;
import net.bytebuddy.implementation.bind.annotation.RuntimeType;
import net.bytebuddy.implementation.bind.annotation.Super;
import net.bytebuddy.implementation.bind.annotation.SuperCall;

import java.lang.reflect.Method;
import java.util.concurrent.Callable;

/**
 * 指定动态的方法
 **/
public class UserManager1 {
    @RuntimeType
    public Object invoke(@Advice.This Object targetObj, @Advice.Origin Method method, @Advice.AllArguments Object[] args, @Super Object targetObj2, @SuperCall
        Callable<?> zuper)  {

        // 调用原方法，使用zuper使用；使用target的反射调用，会递归调用

        return "select User";
    }
}
